//package com.gist.cithub.evaluate.utils;
//
//import com.gist.cithub.evaluate.CithubEvaluateApplication;
//import com.gist.cithub.evaluate.dao.DetailInforDao;
//import com.gist.cithub.evaluate.dao.SumInforDao;
//import com.gist.cithub.evaluate.entity.DetailInforEntity;
//import com.gist.cithub.evaluate.entity.SumInforEntity;
//import org.springframework.beans.factory.annotation.Autowired;
//
//
//
//import java.util.HashMap;
//import java.util.Map;
//
//public class insertData {
//    @Autowired
//    private  SumInforDao sumInforDao;
//    @Autowired
//    private  DetailInforDao detailInforDao;
//    private static    Map<String,Integer> service_serviceid=new HashMap<>();
//    private static String type = "cons";
//    private static String type2 = type+"trained";
//    private static int toolsum = 9;
//    private static int modelsum=146;
////    private static int modelsum=49;
//    private static String workdir = System.getProperty("user.dir")+"\\cithub-evaluate\\src\\main\\java\\com\\gist\\cithub\\evaluate\\utils";
//    public  void test() {
//        //service_id
//        service_serviceid.put("ACTS",46);
//        service_serviceid.put("PICT",52);
//        service_serviceid.put("CASA",53);
//        service_serviceid.put("FastCA",54);
//        service_serviceid.put("tcases",55);
//        service_serviceid.put("jcunit",56);
//        service_serviceid.put("coffee4j",57);
//        service_serviceid.put("medici",58);
//        service_serviceid.put("jenny",59);
//        //read sumfile
//        String sumstr[]=IOUtil.readToString(workdir+"\\suminfor\\"+type+"\\suminfor.csv").split("\n\r");
//        String detailstr[]=IOUtil.readToString(workdir+"\\detailinfor\\"+type+"_RQ1_infos.csv").split("\n\r");
//        for (int i = 0; i <1 ; i++) {
//            String strarr[]=sumstr[i].split(",");
//            SumInforEntity sumInforEntity=new SumInforEntity();
//            sumInforEntity.setCategory(type2);
//            sumInforEntity.setServiceId(service_serviceid.get(strarr[0]));
//            sumInforEntity.setStrength(Integer.parseInt(strarr[1]));
//            sumInforEntity.setTotalSize(Float.parseFloat(strarr[2]));
//            sumInforEntity.setTotalTime(Float.parseFloat(strarr[3]));
//            sumInforEntity.setSuccessRate(Float.parseFloat(strarr[4]));
//            int sumid=sumInforDao.insert(sumInforEntity);
//            for (int k =modelsum*i+1 ; k <modelsum*i+1+modelsum ; k++) {
//                String strarr2[]=detailstr[k].split(",");
//                DetailInforEntity detailInforEntity=new DetailInforEntity();
//                detailInforEntity.setSumId(sumid);
//                detailInforEntity.setName(strarr2[1]);
//                detailInforEntity.setSize(Float.parseFloat(strarr2[3]));
//                detailInforEntity.setTime(Float.parseFloat(strarr2[4]));
//                detailInforEntity.setSuccessRate(Float.parseFloat(strarr2[5]));
//                detailInforDao.insert(detailInforEntity);
//            }
//        }
//
//
//
//
//
//
//
//    }
//
//}
